package kitchen.beans;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * MaterialFood entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "material_food", catalog = "delicacy")
public class MaterialFood implements java.io.Serializable {

	// Fields

	private String materialFoodId;
	private String materialFoodName;
	private String img;
	private String description;
	private Set<MfoodMfoodTypesRelation> mfoodMfoodTypesRelations = new HashSet<MfoodMfoodTypesRelation>(
			0);
	private Set<FoodMaterialFoodRelation> foodMaterialFoodRelations = new HashSet<FoodMaterialFoodRelation>(
			0);

	// Constructors

	/** default constructor */
	public MaterialFood() {
	}

	/** minimal constructor */
	public MaterialFood(String materialFoodId, String materialFoodName) {
		this.materialFoodId = materialFoodId;
		this.materialFoodName = materialFoodName;
	}

	/** full constructor */
	public MaterialFood(String materialFoodId, String materialFoodName,
			String img, String description,
			Set<MfoodMfoodTypesRelation> mfoodMfoodTypesRelations,
			Set<FoodMaterialFoodRelation> foodMaterialFoodRelations) {
		this.materialFoodId = materialFoodId;
		this.materialFoodName = materialFoodName;
		this.img = img;
		this.description = description;
		this.mfoodMfoodTypesRelations = mfoodMfoodTypesRelations;
		this.foodMaterialFoodRelations = foodMaterialFoodRelations;
	}

	// Property accessors
	@Id
	@Column(name = "material_food_id", unique = true, nullable = false, length = 50)
	public String getMaterialFoodId() {
		return this.materialFoodId;
	}

	public void setMaterialFoodId(String materialFoodId) {
		this.materialFoodId = materialFoodId;
	}

	@Column(name = "material_food_name", nullable = false, length = 50)
	public String getMaterialFoodName() {
		return this.materialFoodName;
	}

	public void setMaterialFoodName(String materialFoodName) {
		this.materialFoodName = materialFoodName;
	}

	@Column(name = "img")
	public String getImg() {
		return this.img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	@Column(name = "description")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "materialFood")
	public Set<MfoodMfoodTypesRelation> getMfoodMfoodTypesRelations() {
		return this.mfoodMfoodTypesRelations;
	}

	public void setMfoodMfoodTypesRelations(
			Set<MfoodMfoodTypesRelation> mfoodMfoodTypesRelations) {
		this.mfoodMfoodTypesRelations = mfoodMfoodTypesRelations;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "materialFood")
	public Set<FoodMaterialFoodRelation> getFoodMaterialFoodRelations() {
		return this.foodMaterialFoodRelations;
	}

	public void setFoodMaterialFoodRelations(
			Set<FoodMaterialFoodRelation> foodMaterialFoodRelations) {
		this.foodMaterialFoodRelations = foodMaterialFoodRelations;
	}

}